<%@page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑用户</title>
<%--<script type="text/javascript" src="js/label/jquery.js"></script>--%>
<link href="js/label/css/lanrenzhijia.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/label/lanrenzhijia.js"></script>



	
</head>
<body>
	<form id="form" enctype="multipart/form-data" onsubmit="return iframeCallback(this,closeCurrent);" action="cyzj/editCyzj.do?funId=${funId}" method="post" >
    	<div class="pageContent"  layoutH="35">
			<div class="tabs">
				<div class="tabsHeader">
					<div class="tabsHeaderContent">
						<ul>
							<li><a><span>创业之家基础信息</span></a></li>
							<li><a><span>功能特色</span></a></li>
							<li><a><span>展示信息</span></a></li>
							<li><a href="common/dsRelationListDiv.do?ACTION=${ACTION}&TODO=${TODO}&entityType_I=CyzjOrg&entityId_I=${cyzjOrg.id}" class="j-ajax"><span>驻点导师</span></a></li>
						<c:if test="${ACTION=='VIEW'}">
							<li><a href="activity/activityPager.do?TODO=INC_PAGER&map.orgId=${cyzjOrg.id}" class="j-ajax"><span>承办活动</span></a></li>
						</c:if>
						</ul>
					</div>
				</div>
				<div class="tabsContent"  layoutH="74">
				
				<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				            
				            <dl class="nowrap">
					        	<dt>创业之家名称：</dt>
							    <dd>
							    	<input class="required textInput valid" type="text" alt="" value="${cyzjOrg.orgName }" size="30" name="orgName"/>
					            	<input type="hidden" name="id" value="${cyzjOrg.id }"/>
					            </dd>
							</dl>
				            
				            <dl class="nowrap">
					        	<dt>主体：</dt>
							    <dd>
							    	<input class="required textInput valid" type="text" alt="" value="${cyzjOrg.companyName }" size="30" name="companyName"/>
					            </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>发起人导师：</dt>
							    <dd>
							    <input type="hidden" name="dsEmpId" id="dsEmpId" value="${cyzjOrg.dsEmpId}"/>
							    <input class="required textInput valid" type="text" alt="" value="${Dict.getAlias('DsEmp',cyzjOrg.dsEmpId)}" size="30" id="dsName"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>专管员A：</dt>
							    <dd>
							    	<select name="adminUserId"  class="required">
										<option value=""></option>
									<c:forEach items="${Dict.getList('ZdzxEmp')}"  var="item" varStatus="varStatus">
										<option value="${item.KEY}"  ${cyzjOrg.adminUserId==item.KEY?'selected':''}>${item.VALUE}</option>
							    	</c:forEach>
							    	</select>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>专管员B：</dt>
							    <dd>
							    	<select name="adminUserId2"  class="required">
										<option value=""></option>
									<c:forEach items="${Dict.getList('ZdzxEmp')}"  var="item" varStatus="varStatus">
										<option value="${item.KEY}"  ${cyzjOrg.adminUserId2==item.KEY?'selected':''}>${item.VALUE}</option>
							    	</c:forEach>
							    	</select>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>排序值：</dt>
							    <dd><input class="digits textInput valid" type="text" alt="" value="${object.orderInt }" size="30" name="orderInt" placeholder="请输入排序值"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>所属区域：</dt>
							    <dd>
							    	<select name="areaId"  class="required">
										<option value=""></option>
									<c:forEach items="${Dict.getList('AREA')}"  var="item" varStatus="varStatus">
										<option value="${item.KEY}"  ${cyzjOrg.areaId==item.KEY?'selected':''}>${item.VALUE}</option>
							    	</c:forEach>
							    	</select>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>地址：</dt>
							    <dd><input class="required textInput valid" type="text" alt="" value="${cyzjOrg.address }" size="30" id="address" name="address"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>经纬度：</dt>
							    <dd>
							    	<input class="textInput valid" type="text" readonly size="13" id="xxxx" name="x" value="${cyzjOrg.x}" >
									<input class="textInput valid" type="text" readonly size="13" id="yyyy" name="y" value="${cyzjOrg.y}" >
								<c:if test="${ACTION=='ADD' or ACTION=='MODIFY'}">
									<a style="color: blue;" id="toSetMapPoint">选择位置</a>
									<a href="cyzj/theMap.do" target="dialog" max="true" lookupgroup="lookupOrg" style="color: blue;" id="setMapPoint"></a>
								</c:if>
								<c:if test="${ACTION=='VIEW'}">
									<c:if test="${cyzjOrg.x!=null}">
									<a href="cyzj/toTheMap.do?x=${cyzjOrg.x}&y=${cyzjOrg.y}" style="color: blue;" target="dialog" max="true" lookupgroup="lookupOrg">查看地图</a>
									</c:if>
								</c:if>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>联系人：</dt>
							    <dd><input class="required textInput valid" type="text" alt="" value="${cyzjOrg.contact }" size="30" name="contact"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>联系电话：</dt>
							    <dd><input class="required textInput valid" type="text" alt="" value="${cyzjOrg.tel}" size="30" name="tel"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>总工位数量(个)：</dt>
							    <dd><input class="digits textInput valid" type="text" alt="" value="${cyzjOrg.workSeatQtyInt }" size="30" name="workSeatQtyInt" placeholder="请输入总工位数量"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>工位租金(元/月/工位)：</dt>
							    <dd><input class="digits textInput valid" type="text" alt="" value="${cyzjOrg.workSeatPriceInt }" size="30" name="workSeatPriceInt" placeholder="请输入工位租金，单位为元/月/工位"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>总建筑面积(平米)：</dt>
							    <dd><input class="digits textInput valid" type="text" alt="" value="${cyzjOrg.workAreaInt }" size="30" name="workAreaInt" placeholder="请输入总建筑面积"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>办公室租金(元/月/平米)：</dt>
							    <dd><input class="digits textInput valid" type="text" alt="" value="${cyzjOrg.workAreaPriceInt }" size="30" name="workAreaPriceInt" placeholder="请输入办公室租金，单位为元/月/平米"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>传真：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${cyzjOrg.fax}" size="30" name="fax"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>email：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${cyzjOrg.email }" size="30" name="email"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>官网网站：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${cyzjOrg.http }" size="30" name="http"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>微信公众号：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${cyzjOrg.wx }" size="30" name="wx"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>公众号二维码：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${cyzjOrg.wxCode }" size="30" name="wxCode"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>备注：</dt>
					        	<dd><textarea name="remark" cols="100" rows="3" maxlength="500">${cyzjOrg.remark}</textarea></dd>
					        </dl>
						</fieldset>
					</div>
				
					<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				           
				            <dl class="nowrap">
					        	<dt>主要特色：
								    </dt>
							    <dd>
								    <div class="plus-tag">
										<input type="hidden" size="30" name="labelMain"  id="labelMain"/>
										<c:forEach items="${labelMainList}" var="main">
											<a value="labelMainText" title="${main.label}" href="javascript:void(0);"><span>${main.label}</span><em data-id="${main.id}"></em></a>
										</c:forEach>
									</div><br>
									
								<c:if test="${ACTION!='VIEW'}">
								    <input class="textInput valid" type="text" alt="" size="30" name="labelMainText"/>
									<a href="javascript:void(0)" data-id="labelMainText" class="plus-tag-add">添加标签</a>


									<div class="default-tag tagbtn">
										<div class="clearfix">
											<c:forEach items="${allLabelMainList}" var="label">
												<a value="labelMainText" title="${label.label}" href="javascript:void(0);"><span>${label.label}(${label.totalCnt})</span><em></em></a>
											</c:forEach>
										</div>
									</div>
								</c:if>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>共享设施：</dt>
							    <dd>
									<div class="plus-tag">
										<input type="hidden" size="30" name="labelOffice"  id="labelOffice"/>
										<c:forEach items="${labelOfficeList}" var="office">
											<a value="labelOfficeText" title="${office.label}" href="javascript:void(0);"><span>${office.label}</span><em data-id="${office.id}"></em></a>
										</c:forEach>
								    </div><br>
								    
								<c:if test="${ACTION!='VIEW'}">
								    <input class="textInput valid" type="text" alt="" size="30" name="labelOfficeText"/>
									<a href="javascript:void(0)" data-id="labelOfficeText" class="plus-tag-add">添加标签</a>


									<div class="default-tag tagbtn">
										<div class="clearfix">
											<c:forEach items="${allLabelOfficeList}" var="label">
												<a value="labelOfficeText" title="${label.label}" href="javascript:void(0);"><span>${label.label}(${label.totalCnt})</span><em></em></a>
											</c:forEach>
										</div>
									</div>
								</c:if>
								</dd>
							</dl>
						</fieldset>
					</div>
				

				
					<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				           
				            <dl class="nowrap">
					        	<dt>Logo<br>(建议160*160)：</dt>
					        	<dd>
									<div class="unit">
										<div class="upload-wrap">
											<div class="thumbnail">
											<img src="${Dict.prefix('UPLOAD')}${cyzjOrg.logoUrl}" data-width="0" data-height="0" width="80">
												<div style="position: absolute;left:0px;top: 56px;">
														<a class="btnLook" href="common/imgShower.do?url=${cyzjOrg.logoUrl}" target="dialog" max="true" rel="ImgShowDialog"><span>预览</span> </a>
												</div>
											</div>
											
										<c:if test="${ACTION!='VIEW'}">
											<input type="file" name="logo" accept="image/*">
										</c:if>
										</div>
									</div>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>首页大图<br>(建议800*450)：</dt>
					        	<dd>
									<div class="unit">
										<div class="upload-wrap">
											<div class="thumbnail">
												<img src="${Dict.prefix('UPLOAD')}${cyzjOrg.mainPicUrl}" data-width="0" data-height="0" width="80" data-action="zoom">
											</div>
										<c:if test="${ACTION!='VIEW'}">
											<input type="file" name="mainPic" accept="image/*">
										</c:if>
										</div>
									</div>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>轮播图<br>(建议800*450)：</dt>
					        	<dd> 
					        		<div class="unit">
										<ul id="upload-preview" class="upload-preview">
											<input type="hidden" id="delPicIds" name="delPicIds"/>
											<c:forEach items="${picLoop}" var="pic" varStatus="varStatus">
												<li class="oldPic thumbnail">
													<img src="${Dict.prefix('UPLOAD')}${pic.filePath}" data-width="0" data-height="0" width="80">
													
													<div style="position: absolute;left:0px;top: 56px;">
														<a class="btnLook" href="common/imgShower.do?url=${pic.filePath}" target="dialog" max="true" rel="ImgShowDialog"><span>预览</span> </a>
													</div>
													
												<c:if test="${ACTION!='VIEW'}">
												
													<div style="position: absolute;left:55px;top: 56px;" 
														data-id="${pic.id}" 
														onclick="javascript:document.getElementById('delPicIds').value+=this.getAttribute('data-id')+',';this.parentNode.parentNode.removeChild(this.parentNode);">
														<a class="btnDel " href="javascript:;"></a>
													</div>
												</c:if>
												</li>
											</c:forEach>
										</ul>
										
									<c:if test="${ACTION!='VIEW'}">
										<div class="upload-wrap" rel="#upload-preview">
											<input type="file" name="picLoopFile" accept="image/*" multiple="multiple">
										</div>
									</c:if>
									</div>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>创业之家简介：</dt>
					        	<dd><textarea placeholder="请输入创业之家简介，不超过500字" name="orgDesc" cols="120" rows="4" maxlength="500">${cyzjOrg.orgDesc}</textarea></dd>
					        </dl>
				            <dl class="nowrap">
					        	<dt>政策支持：</dt>
					        	<dd><textarea placeholder="请输入政策支持相关信息，不超过500字"  name="supportDesc" cols="120" rows="4" maxlength="500">${cyzjOrg.supportDesc}</textarea></dd>
					        </dl>
						</fieldset>
					</div>
					<div>  
						驻点导师				
					</div>
				<c:if test="${ACTION=='VIEW'}">
					<div>  
						承办活动			
					</div>
				</c:if>
			</div>
			<div class="tabsFooter">
				<div class="tabsFooterContent"></div>
			</div>
		</div>
	</div>
				
    <div class="formBar">
         <ul>
         		<li>
         			<input type="hidden" id="approveStatus" name="approveStatus" value=""/>
            		<input type="hidden" id="ACTION" name="ACTION" value="${ACTION }"/>
            		<input type="hidden" id="TODO" name="TODO" value="${TODO }"/>
            	</li>
             	<li class="EDIT" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('UNSUBMIT')">保存</button></div></div></li>
             	<li class="EDIT" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('SUBMITED')">保存并提交</button></div></div></li>
             	<li class="UPDATE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('${cyzjOrg.approveStatus}')">保存</button></div></div></li>
            	<li class="APPROVE" style="display:none">审核意见：<input id="approveDesc" class="textInput valid approveObj" type="text" alt="" size="30" name="approveDesc"></input></li>
            	<li class="APPROVE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('APPROVED')">审核通过</button></div></div></li>
             	<li class="APPROVE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('REJECTED')">审核驳回</button></div></div></li>
             	<li><div class="button"><div class="buttonContent"><button class="close" type="button">取消</button></div></div></li>
         </ul>
    </div>
</form>

</body>
	<script type="text/javascript">
	
	$(document).ready(function(){
		initView("${ACTION}","${TODO}","${readyMsg}");
		
		
		setEmp = function (event, ui) { 
	        if (ui != null && ui.item != null) { 
	            $("#dsEmpId",navTab.getCurrentPanel()).val(ui.item.id); 
	        } 
	    };
	    
		$("#dsName",navTab.getCurrentPanel()).autocomplete({
			source: getDsEmp,
			minLength:1,
			select: setEmp
		});
		
		$("#xy",navTab.getCurrentPanel()).hide();
		$("#theMap").click(function(){
			var id = setInterval(function(){
				if($("#xy").val()!=""){
					$("#xy",navTab.getCurrentPanel()).show();
					clearInterval(id);
				}
			},
			1000);
			
		});
		
		
		$("#toSetMapPoint").click(function(){
			$("#setMapPoint").attr("href","cyzj/toTheMap.do?address="+$("#address").val());
			$("#setMapPoint").click();
		});
		
		//$("#saleOrderItemPage",navTab.getCurrentPanel()).loadUrl("order/saleOrderItemPager.do?orderId=${cyzjOrg.id}");
		
	});
//	initLabel = function(){
//		var labelMain = "";
//		var labelOffice = "";
//		$(".plus-tag a").each(function(){
//			var labelType = $(this).attr("value");
//			var label = $(this).attr("title");
//			if("labelMainText"==labelType){
//				labelMain = labelMain + "," + label;
//			}else if("labelOfficeText"==labelType){
//				labelOffice = labelOffice+ "," + label;
//			}
//		})
//		$('#labelMain',navTab.getCurrentPanel()).val(labelMain);
//		$('#labelOffice',navTab.getCurrentPanel()).val(labelOffice);
//	};
	
	initSubmit = function(approveStatus){
		$('#approveStatus',navTab.getCurrentPanel()).val(approveStatus);
//		initLabel();
		if(approveStatus=='UNSUBMIT'){
			$('#TODO',navTab.getCurrentPanel()).val("EDIT");
		}else if(approveStatus=='SUBMITED'){
			$('#TODO',navTab.getCurrentPanel()).val("SUBMIT");
		}else if(approveStatus=='APPROVED'){
			$('#TODO',navTab.getCurrentPanel()).val("APPROVE");
			return isConfirm('是否确认审核通过？');
		}else if(approveStatus=='REJECTED'){
			$('#TODO',navTab.getCurrentPanel()).val("APPROVE");
			return isConfirm('是否确认审核驳回？');
		}
		
	}


</script>
</html>

